import { ref } from 'vue'
import type { Ref } from 'vue'
import config0 from '@/assets/config/0.ts'

// 全局配置 ***********************************************//

const version = ref('0.0.1')

// 全局变量 ***********************************************//
const selectWallpaperValue = ref(0)
const background: Ref<BACKGROUND> = ref(config0.backgroundImage)
const assetsPath: Ref<ASSETS_PATH> = ref(config0.assetsPath)
const bgm: Ref<string> = ref(config0.bgm.src)
const bgmToggle = ref(false)
const bgmVolume = ref(0.35)
const spineData: Ref<SPINE_DATA[]> = ref(config0.spineData)
const offset: Ref<OFFSET> = ref(config0.offset)

// 全局设置 ***********************************************//
const bgmList: Ref<BGM[]> = ref(config0.bgms)

// 本地存储
const selectWallpaperValueKey =  'selectWallpaperValue'
const bgmToggleKey = 'bgmToggle'
const bgmVolumeKey = 'bgmVolume'
const bgmKey = 'bgm'

export {
    version,
    // 基础属性
    selectWallpaperValue,
    background,
    assetsPath,
    bgm,
    bgmToggle,
    bgmVolume,
    spineData,
    offset,
    // 全局设置
    bgmList,
    // 本地存储
    selectWallpaperValueKey,
    bgmToggleKey,
    bgmVolumeKey,
    bgmKey,
}